package site.yunnong.atvris.service.impl;

import org.springframework.stereotype.Service;
import site.yunnong.atvris.common.utils.SqlUtils;
import site.yunnong.atvris.dao.domain.UserStarPack;
import site.yunnong.atvris.dao.domain.UserStarPackExample;
import site.yunnong.atvris.dao.mapper.UserStarPackMapper;
import site.yunnong.atvris.service.UserStarPackService;

import javax.annotation.Resource;
import java.util.List;

/**
 * 
 *
 * @author zhangjinghao
 * @email jhzhang9102@163.com
 * @date 2021-07-09 23:45:37
 */
@Service
public class UserStarPackServiceImpl implements UserStarPackService {
    
    @Resource
    private UserStarPackMapper userStarPackMapper;

    @Override
    public List<UserStarPack> queryStarPackByUuid(Long uuid) {
        UserStarPackExample example = new UserStarPackExample();
        example.createCriteria().andUuidEqualTo(uuid);
        example.setOrderByClause(SqlUtils.generateOrderByClause("create_time", "asc"));
        return userStarPackMapper.selectByExample(example);
    }

    @Override
    public void newStarPack(UserStarPack pack) {
        userStarPackMapper.insertSelective(pack);
    }
}

